﻿<Fluent:RibbonWindow x:Class="NetSnoop.Window"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
Title="NetSnoop" Width="786" Height="528" WindowState="Normal" Loaded="RibbonWindow_Loaded">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <!-- ### FLUENT HEADER ### -->
        
        <Fluent:Ribbon Grid.ColumnSpan="2" Grid.Row="0">
            <!--Backstage-->
            <Fluent:Ribbon.Menu>
                <Fluent:Backstage Header="Options">
                    <Fluent:BackstageTabControl>
                        <Fluent:BackstageTabItem Header="New">
                            <StackPanel Name="OptionsPanelNew">
                                <Label Name="lblLogPath">Logfile Path: </Label>
                                <TextBox Name="txtLogPath" />
                            </StackPanel>
                        </Fluent:BackstageTabItem>
                        <Fluent:BackstageTabItem Header="Print"/>
                    </Fluent:BackstageTabControl>
                </Fluent:Backstage>
            </Fluent:Ribbon.Menu>
            <!--Tabs-->
            <Fluent:RibbonTabItem Header="Network">
                <Fluent:RibbonGroupBox Header="TCP Settings">
                    <Fluent:ToggleButton Name="buttonGreen" Header="IPv4" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" />
                    <Fluent:ToggleButton Name="buttonGray" Header="IPv6" Icon="Images\Gray.png" LargeIcon="Images\GrayLarge.png" />                 
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="Refresh">
                    <Fluent:DropDownButton Name="buttonTimer" Header="Timer" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png">
                        <Fluent:RadioButton Name="menuTimer10" Header="10ms" />
                        <Fluent:RadioButton Name="menuTimer50" Header="50ms" />
                        <Fluent:RadioButton Name="menuTimer100" Header="100ms" />
                        <Fluent:RadioButton Name="menuTimer1000" Header="1000ms" />
                    </Fluent:DropDownButton>
                </Fluent:RibbonGroupBox>

            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="Logging">
                <Fluent:RibbonGroupBox Header="Logfiles">
                    <Fluent:Button Name="buttonGreen2" Header="Green" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" />
                    <Fluent:Button Name="buttonGray2" Header="Grey" Icon="Images\Gray.png" LargeIcon="Images\GrayLarge.png" />                 
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
        </Fluent:Ribbon>

        <!-- ### AVALON DOCK PANEL ### -->

        <ad:DockingManager x:Name="dockManager" Grid.Row="1">
            <ad:ResizingPanel Orientation="Vertical">
                <!-- DOCUMENT AREA-->               
                <ad:ResizingPanel Orientation="Horizontal">
                    <ad:DocumentPane ad:ResizingPanel.ResizeWidth="500" Name="AdDocPane">
                        <ad:DocumentContent Title="Network Connections" IsCloseable="False">
                            <ListView Name="listConnection" >
                                <ListView.View>
                                    <GridView>
                                        <GridView.Columns>
                                            <!-- Binding to the ListView -->
                                            <GridViewColumn Header="Type" DisplayMemberBinding="{Binding Type}" />
                                            <GridViewColumn Header="Local Address" DisplayMemberBinding="{Binding LocalAddress}" />
                                            <GridViewColumn Header="Local Port" DisplayMemberBinding="{Binding LocalPort}" />
                                            <GridViewColumn Header="Remote Address" DisplayMemberBinding="{Binding RemoteAddress}" />
                                            <GridViewColumn Header="Remote Port" DisplayMemberBinding="{Binding RemotePort}" />
                                            <GridViewColumn Header="State" DisplayMemberBinding="{Binding State}" />
                                            <GridViewColumn Header="PID" DisplayMemberBinding="{Binding ProcessId}" />
                                        </GridView.Columns>
                                    </GridView>
                                </ListView.View>
                            </ListView>
                        </ad:DocumentContent>
                    </ad:DocumentPane>
                </ad:ResizingPanel>
                
                <ad:DockablePane ad:ResizingPanel.ResizeHeight="100">
                    <ad:DockableContent Title="Process Information" x:Name="procinfo">
                        <!--debug-->
                        <ListView>
                            <ListView.View>
                                <GridView>
                                    <GridView.Columns>
                                        <GridViewColumn Header="Error"/>
                                        <GridViewColumn Header="Page"/>
                                        <GridViewColumn Header="File"/>
                                        <GridViewColumn Header="Row"/>
                                    </GridView.Columns>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </ad:DockableContent>
                    <ad:DockableContent Title="Statistics" x:Name="statistics">
                        <TextBox IsReadOnly="True" AcceptsReturn="True"/> <!--debug-->
                    </ad:DockableContent>
                </ad:DockablePane>
            </ad:ResizingPanel>

        </ad:DockingManager>

    </Grid>
</Fluent:RibbonWindow>